/* 
 * Cashbox is the legal property of its developers, whose names are listed in the copyright file included
 * with this source distribution.
 * 
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
 * General Public License as published by the Free Software Foundation; either version 2 of the License,
 * or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
 * Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with this program; if not,
 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

#import "CBThickSplitView.h"

#define GRAY_COLOR 0.64705882
#define START 0.98823529
#define END 0.8745098

@implementation CBThickSplitView

- (float)dividerThickness {
	return 10;
}

- (void)drawDividerInRect:(NSRect)aRect {
	[self lockFocus];
	
	[[NSColor colorWithCalibratedRed:GRAY_COLOR green:GRAY_COLOR blue:GRAY_COLOR alpha:1] set];
	[NSBezierPath fillRect:aRect];
	
	// draw the gradient
	AIGradient *gradient;
	gradient = [AIGradient gradientWithFirstColor:[NSColor colorWithCalibratedRed:START green:START blue:START alpha:1]
									  secondColor:[NSColor colorWithCalibratedRed:END green:END blue:END alpha:1]
										direction:AIVertical];
	[gradient drawInRect:NSMakeRect(aRect.origin.x, aRect.origin.y + 1, aRect.size.width, aRect.size.height - 2)];
	


	// draw the handle

	aRect.origin.y += aRect.size.height - 2;
	aRect.size.height = 1;
	
	aRect.origin.y -= 5;
	aRect.origin.x = aRect.origin.x + (aRect.size.width / 2) - 2;
	aRect.size.width = 4;
	[[NSColor colorWithCalibratedRed:0.81176471 green:0.81176471 blue:0.81176471 alpha:1] set];
	[NSBezierPath fillRect:aRect];
	
	aRect.origin.x += 1;
	aRect.size.width -= 2;
	[[NSColor colorWithCalibratedRed:0.61176471 green:0.61176471 blue:0.61176471 alpha:1] set];
	[NSBezierPath fillRect:aRect];
	
	aRect.origin.y += 1;
	aRect.origin.x -=1;
	aRect.size.width += 2;
	[[NSColor colorWithCalibratedRed:0.64705882 green:0.64705882 blue:0.64705882 alpha:1] set];
	[NSBezierPath fillRect:aRect];
	
	aRect.origin.x +=1;
	aRect.size.width -= 2;
	[[NSColor colorWithCalibratedRed:0.7254902 green:0.7254902 blue:0.7254902 alpha:1] set];
	[NSBezierPath fillRect:aRect];
	
	aRect.origin.y += 1;
	aRect.origin.x -=1;
	aRect.size.width += 2;
	[[NSColor colorWithCalibratedRed:0.68627451 green:0.68627451 blue:0.68627451 alpha:1] set];
	[NSBezierPath fillRect:aRect];
	
	aRect.origin.x +=1;
	aRect.size.width -= 2;
	[[NSColor colorWithCalibratedRed:0.80392157 green:0.80392157 blue:0.80392157 alpha:1] set];
	[NSBezierPath fillRect:aRect];
	
	aRect.origin.y += 1;
	aRect.origin.x -=1;
	aRect.size.width += 2;
	[[NSColor colorWithCalibratedRed:0.82745098 green:0.82745098 blue:0.82745098 alpha:1] set];
	[NSBezierPath fillRect:aRect];
	
	aRect.origin.x +=1;
	aRect.size.width -= 2;
	[[NSColor colorWithCalibratedRed:0.72156863 green:0.72156863 blue:0.72156863 alpha:1] set];
	[NSBezierPath fillRect:aRect];
	
	[self unlockFocus];
}

@end
